package com.example.cvte.service;

import com.example.cvte.mapper.UserMapper;
import com.example.cvte.model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 郝文雪
 * @date 2022/10/31 13:49
 * @Description Test
 */
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    /**
     * 添加用户
     * @param username 用户名
     * @param nickname 昵称
     * @param password 密码
     * @return
     */
    public int addUser(String username,String nickname,String password){
        return userMapper.addUser(username,nickname,password);
    }

    /**
     * 根据用户名查找用户
     * @param username 用户名
     * @return
     */
    public UserInfo getUserByUsername(String username){
        return userMapper.getUserByUsername(username);
    }
}
